<template>
  <div>
    <a-modal
      title="数组配置"
      :visible="visible"
      @ok="handleOK"
      @cancel="visible = false"
    >
      <a-space>
        数组大小:<a-input-number v-model="count"></a-input-number>
        开始位置:<a-input-number v-model="beginPos"></a-input-number
      ></a-space>
    </a-modal>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      callback: null,
      count: 1,
      beginPos: 0,
    };
  },
  methods: {
    handleOK() {
      if (this.callback) {
        this.callback({ count: this.count, beginPos: this.beginPos });
        this.visible = false;
      }
    },
    Show(owner, callback) {
      this.callback = callback;
      this.visible = true;
    },
  },
};
</script>